import { request,BASEURL} from '../../utils/request';
Page({

  /**
   * 页面的初始数据
   */
  data: {
    goodsResu:[],
    BASEURL:'',
    goodsList:{}
  },
  onLoad: function (options) {
    this.goodsResu()
  },
  //收益记录数据
  async goodsResu(){
    let {openid} = wx.getStorageSync('uid')
    let res = await request({
      url: '/api/Wxapp/achievementLog',
      method:"POST",
      data:{
        openid
      }
    })
    console.log(res)
    let goodsResu = res.data.data
    this.setData({
      goodsResu,
      BASEURL
    })
  },

  onShow: function () {
    let goodsList = this.data.goodsResu.forEach(v=>v.uinfo)
    this.setData({
      goodsList
    })
  },
  onHide: function () {

  },


  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    let {openid} = wx.getStorageSync('uid')
    return {
      title: "邀请好友",
      path:`/pages/index/index?pid=${openid}` 
    }
  }
})